﻿Public Class HesapPlani
	Inherits Process

	Public Overrides Sub GenericEvent(ByVal e As ProcessEventArgs)
		Select Case e.EventType
			Case EventType.Initialize
				Start("HesapPlanı", "Hesap planı listelenmiştir.")
				AddTree()
				Rs = Muhasebe.HesapPlani.Liste(Remote)
				Do Until Rs.EOF
					For i As Integer = 1 To 7 Step 2
						Dim Nodes() As TreeNode = Tree.Nodes.Find(Mid(Rs("hesapno"), 1, i), True)
						If Nodes.Length = 0 Then
							Tree.AddNode(If(i = 1, "", Mid(Rs("hesapno"), 1, i - 2)), Mid(Rs("hesapno"), 1, i), Mid(Rs("hesapno"), 1, i) & If(i < 7, "", " - " & Rs("hesapadi")))
						End If
					Next
					Rs.MoveNext()
				Loop
		End Select
	End Sub

End Class
